#include "stm32f10x_iwdg.h"
#include "wdg.h"
void watch_dog_init(void)
{
	 IWDG_WriteAccessCmd(0x5555);
	 IWDG_SetPrescaler(IWDG_Prescaler_256);
	 IWDG_SetReload(0x0fff);
	 IWDG_Enable();							//Time_out=4095*128/40k = 12.8 sec.

}

void watch_dog_start(void)
{
	IWDG_Enable();
}
void feed_dog(void)
{
	IWDG_ReloadCounter();
}




